#!/usr/bin/env python
# encoding: utf-8
# @author: liusir
# @file: demo_09.py
# @time: 2022/11/16 8:36 PM

import unittest
import paramunittest

test_data = [
    {'numa':30,'numb':40,'numc':70},
    {'numa':40,'numb':60,'numc':100}
]
def get_data():
    return test_data
# 传入字典 == 传入方法的调用
@paramunittest.parametrized(
    *get_data()
)
class TestDemo(paramunittest.ParametrizedTestCase):
    def setParameters(self, numa, numb,numc):
        self.a = numa
        self.b = numb
        self.c = numc
    def test_add_case(self):
        print("%d + %d ?= %d" % (self.a, self.b, self.c))
        self.assertEqual(self.a + self.b, self.c)
if __name__=="__main__":
    unittest.main()